/* 
 * main javascript function
 */
function show(e)
{
    $(e).css('display', 'block');
}

function hide(e)
{
    $(e).css('display', 'none');
}

function deleteRingtone(id)
{
    if(confirm('Are you sure?'))
    {
        location.href = "/ringtone/delete?id="+id;
        return true;
    }

    return false;
}

function showFilter(divId)
{
	divFilter = document.getElementById(divId);
	if (divFilter.style.display == "none")
	{
		divFilter.style.display = "block";		
	} 
	else
	{
		divFilter.style.display = "none";	
	}
	return false;
}
/**
*
*  Javascript trim, ltrim, rtrim
*  http://www.webtoolkit.info/
*
**/
 
function trim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
}
 
function ltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
 
function rtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}